import Vue from 'vue'
import App from './App.vue'
import router from './router'
import store from './store'
import {Message} from 'element-ui'


Vue.prototype.$message = Message


import "@/assets/css/public.css"
import "@/assets/css/index.css"

Vue.config.productionTip = false
Vue.prototype.$commonMethod = function(num) {
      num = Number(num).toFixed(2); // 保留2位小数
      return '￥' + num.replace(/\B(?=(\d{3})+(?!\d))/g, ',');
};

Vue.prototype.$routeJump = function(data) {
  if (!this.$router) {
    console.error('Router not initialized')
    return
  }
  if (!data) {
    console.warn('Missing goodsId')
    return
  }
  
  this.$router.push({ 
    path: "/goods", 
    query: { id: data } 
  })
}



new Vue({
  router,
  store,
  render: h => h(App)
}).$mount('#app')
